<%@ page import="java.sql.*, studentportal.*"%>

<html>

<head>
 
<title>Student Portal</title>
<meta name="Microsoft Theme" content="indust 011">
</head>

<body background="indtextb.jpg" bgcolor="#FFFFFF" text="#000000" link="#3366CC" vlink="#666666" alink="#996600">

<!--mstheme--><font face="Trebuchet MS, Arial, Helvetica"><!--mstheme--></font>

<table border="0" width="100%">
  <tr>
    <td width="100%"><!--mstheme--><font face="Trebuchet MS, Arial, Helvetica"><img border="0" src="StdPrtlbanner.jpg" width="846" height="65">&nbsp;<!--mstheme--></font></td>
  </tr>
</table>
<!--mstheme--><font face="Trebuchet MS, Arial, Helvetica"><!--mstheme--></font>
<table border="0" width="100%">
  <tr>
    <td width="23%">
      <!--mstheme--><font face="Trebuchet MS, Arial, Helvetica">
      <p align="center"><a href="AdminAdmissionHome.html">Admissions</a><!--mstheme--></font></td>
    <td width="23%">
      <!--mstheme--><font face="Trebuchet MS, Arial, Helvetica">
      <p align="center"><a href="AdminStudentHome.html">Students</a><!--mstheme--></font></td>
    <td width="23%">
      <!--mstheme--><font face="Trebuchet MS, Arial, Helvetica">
      <p align="center"><a href="AdminFacultyHome.html">Faculties</a><!--mstheme--></font></td>

    <td width="20%">
      <!--mstheme--><font face="Trebuchet MS, Arial, Helvetica">
      <p align="center"><a href="AdminNotificaiton.jsp">Notifications</a><!--mstheme--></font></td>

    <td width="20%">
      <!--mstheme--><font face="Trebuchet MS, Arial, Helvetica">
      <p align="center"><a href="AdminExamHome.html">Examination</a><!--mstheme--></font></td>


    <td width="20%">
      <!--mstheme--><font face="Trebuchet MS, Arial, Helvetica">
      <p align="center"><a href="AdminBranchHome.html">Branches</a><!--mstheme--></font></td>

    <td width="20%">
      <!--mstheme--><font face="Trebuchet MS, Arial, Helvetica">
      <p align="center"><a href="AdminBooksHome.html">Books</a><!--mstheme--></font></td>
    <td width="20%">
      <!--mstheme--><font face="Trebuchet MS, Arial, Helvetica">
      <p align="center"><a href="AdminCourseHome.html">Courses</a><!--mstheme--></font></td>

    <td width="20%">
      <!--mstheme--><font face="Trebuchet MS, Arial, Helvetica">
      <p align="center"><a href="AdminSemesterHome.html">Semesters</a><!--mstheme--></font></td>

    <td width="20%">
      <!--mstheme--><font face="Trebuchet MS, Arial, Helvetica">
      <p align="center"><a href="AdminSubjectHome.html">Subjects</a><!--mstheme--></font></td>

    <td width="20%">
      <!--mstheme--><font face="Trebuchet MS, Arial, Helvetica"><a href="AdminDesignationHome.html">Designation</a><!--mstheme--></font></td>

	  <td width="20%">
      <!--mstheme--><font face="Trebuchet MS, Arial, Helvetica">
      <p align="center"><a href="Home.html">Home</a><!--mstheme--></font></td>
  </tr>
</table>
<!--mstheme--><font face="Trebuchet MS, Arial, Helvetica">

<font face="Trebuchet MS, Arial, Helvetica">
	<form method="POST" action="">
  
	  <p>
            &nbsp;<!--mstheme--></font>
			<table align="center" border="0">
				<tr>
					<th><!--mstheme--><font face="Trebuchet MS, Arial, Helvetica">Admission ID<!--mstheme--></font></th>
					<th><!--mstheme--><font face="Trebuchet MS, Arial, Helvetica">Admission Name<!--mstheme--></font></th>
					<th><!--mstheme--><font face="Trebuchet MS, Arial, Helvetica">Admission Status<!--mstheme--></font></th>
					<th><!--mstheme--><font face="Trebuchet MS, Arial, Helvetica">Update Status<!--mstheme--></font></th>
				</tr>
				<%
					Connection con=MySQLDriver.getConnection(); 
					con.setAutoCommit(false);
					Statement st=con.createStatement();
					ResultSet rs=null;
					System.out.println("After Statement");
					String fid=request.getParameter("ID");
					String fstatus=request.getParameter("STATUS");

					if(fid!=null || fstatus!=null)
					{
						Statement st1=con.createStatement();
						int i=0;
						String ssss="update admission_master set STATUS='Y'  where id='"+fid+"'";
						System.out.println(ssss);
						
						if(fstatus.equalsIgnoreCase("Y"))
							i=st1.executeUpdate("update admission_master set STATUS='N'  where id="+fid);
						else 
							i=st1.executeUpdate("update admission_master set STATUS='Y'  where id="+fid);
						con.commit();
						st1.close();
					}
					
					rs=st.executeQuery("select * from admission_master");
					if(rs!=null)
					{
						while(rs.next())
						{
								System.out.println("In While");
								String fcid=rs.getString(1);

				%>
					
						<tr>
							<td align="center"><!--mstheme--><font face="Trebuchet MS, Arial, Helvetica"><%=fcid%><!--mstheme--></font></td>
							<td align="center"><!--mstheme--><font face="Trebuchet MS, Arial, Helvetica"><%=rs.getString(2)%><!--mstheme--></font></td>
							<%String status=rs.getString(3);%>
							<td align="center"><!--mstheme--><font face="Trebuchet MS, Arial, Helvetica"><%=status%><!--mstheme--></font></td>
							<td align="center">
                            <!--mstheme--><font face="Trebuchet MS, Arial, Helvetica">
							<a href="./AdminUpdateAdmissionMasterEntry.jsp?ID=<%=fcid%>&STATUS=<%=status%>">Update Status</a><!--mstheme--></font></td>
						</tr>
					
				<%
					
					}
					rs.close();
					st.close();
					con.close();
					}
					else
					{
				%>
					<tr>
							<td align="center" colspan="10"><!--mstheme--><font face="Trebuchet MS, Arial, Helvetica">There is No New Students<!--mstheme--></font></td>
					</tr>
							
				<%
					}						
				%>
				
				</table>
    <!--mstheme--><font face="Trebuchet MS, Arial, Helvetica">
	</form>
</font>

<!--mstheme--></font>

</body>

</html>
